import React from 'react'
import { HashRouter as Router, Switch, Route } from 'react-router-dom'
import { Provider } from 'react-redux'
import PrivateRoute from './components/PrivateRoute'
import store from './store'

import './App.css'
import Login from './views/Login'
import Register from './views/Register'
import Home from './views/Home'

const App = () =>{
    return (
        <Provider store={store}>
            <Router>
                <Switch>
                    <Route path="/login" component={ Login }></Route>
                    <Route path="/register" component={ Register }></Route>
                    <PrivateRoute path='/' component={Home}></PrivateRoute>
                </Switch>
            </Router>
        </Provider>
    )
}

export default App